package com.github.chxiaowu.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.github.chxiaowu.mongo.MongoHelper;

@Configuration
public class MongoConfig {

	static Logger LOG = LoggerFactory.getLogger(MongoConfig.class);

	@Value("${spring.data.mongodb.uri}")
	private String mongouri;

	@Bean
	public MongoHelper mongodbHelper() {
		MongoHelper helper = new MongoHelper();
		helper.setUri(mongouri);
		helper.init();
		return helper;
	}

//	@Bean
//	public MongoDatabase mongoDatabase(MongoHelper mongodbHelper) {
//		return mongodbHelper.getDatabase();
//	}

}
